package Forms;

import MainPanels.*;
import javax.swing.*;

import java.awt.*;

public class MainForm extends JFrame {
	
	JPanel leftPartPanel;
	
	TaskPanel taskPanel;
	BookFlightPanel bookFlightPanel;
	ObjectToAddPanel objectToAddPanel;
	DisplayFlightPanel flightDisplayPanel;
	AddObjectPanel addFlightPanel;
	
	public MainForm()
	{	
		bookFlightPanel = new BookFlightPanel();
		
		objectToAddPanel = new ObjectToAddPanel();
		
		taskPanel = new TaskPanel(bookFlightPanel, objectToAddPanel);
		
		leftPartPanel = new JPanel();
		leftPartPanel.setLayout(new BoxLayout(leftPartPanel, BoxLayout.Y_AXIS));
		leftPartPanel.add(taskPanel);
		leftPartPanel.add(bookFlightPanel);
		leftPartPanel.add(objectToAddPanel);
		
		flightDisplayPanel = new DisplayFlightPanel();
		
		this.setExtendedState(Frame.MAXIMIZED_BOTH);
		this.setMinimumSize(new Dimension(900, 600));
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("Flight Booking System");
		
		this.setLayout(new BorderLayout());
		
		this.add(leftPartPanel, BorderLayout.WEST);
		this.add(flightDisplayPanel, BorderLayout.CENTER);
		
		this.setVisible(true);
	}
	
}
